package test.viewmodel;


import model.Grammar;

import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.util.Clients;

public class GrammDataVM {
	
	private GrammDataModel grammData;
	
	public GrammDataVM(){
		grammData = new GrammDataModel();
	}

	public GrammDataModel getGrammData() {
		return grammData;
	}


	@Command
	public void selectGramm(@BindingParam("gramm") Grammar selectGramm){
		Clients.showNotification("Select "+selectGramm.getName(), "info", null,"middle_center",1000);
	}
	
	@Command
	@NotifyChange("grammData")
	public void delGramm(@BindingParam("gramm") Grammar selectGramm){
		grammData.removeGramm(selectGramm);
	}
	
}
